package org.salatec.tapestry4e.editors;

import org.eclipse.jface.text.IAutoEditStrategy;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.wst.html.core.text.IHTMLPartitions;
import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
import org.eclipse.wst.html.ui.internal.contentassist.HTMLContentAssistProcessor;
import org.eclipse.wst.sse.core.internal.Logger;
import org.eclipse.wst.xml.core.text.IXMLPartitions;
import org.salatec.tapestry4e.text.TMLContentAssistProcessor;

public class StructuredTextViewerConfigurationTML extends
		StructuredTextViewerConfigurationHTML {

	public StructuredTextViewerConfigurationTML() {
		super();

	}

	protected IContentAssistProcessor[] getContentAssistProcessors(
			ISourceViewer sourceViewer, String partitionType) {
		// Logger.log(Logger.INFO, "Partition Type: " + partitionType);
		IContentAssistProcessor[] processors = null;
		Logger.log(Logger.INFO, partitionType);
		if ((partitionType == IHTMLPartitions.HTML_DEFAULT)
				|| (partitionType == IHTMLPartitions.HTML_COMMENT)
				|| (partitionType == IXMLPartitions.XML_DEFAULT)) {
			processors = new IContentAssistProcessor[] {

			new TMLContentAssistProcessor(), new HTMLContentAssistProcessor() };
		} else {
			processors = super.getContentAssistProcessors(sourceViewer,
					partitionType);
		}

		return processors;

	}

	public IAutoEditStrategy[] getAutoEditStrategies(
			ISourceViewer sourceViewer, String contentType) {
		return super.getAutoEditStrategies(sourceViewer, contentType);
	}
}
